import sys
sys.path.append('../base')
# 从base模块中导入Base类
from base import Base
# 导入配置信息
import settings
# 定义登录页面类，继承Base
class PageLogin(Base):
    def page_input_username(self, username): # 输入用户名
        self.base_input(settings.login_username, username)
    def page_input_password(self, password): # 输入密码
        self.base_input(settings.login_password, password)
    def page_click_login_btn(self): # 点击按钮
        self.base_click(settings.login_btn)
    def page_login(self, username, password): # 组装登录的操作
        self.page_input_username(username)
        self.page_input_password(password)
        self.page_click_login_btn()
    def page_get_result(self): # 获取的登录结果
        return self.base_get_text(settings.login_result)
if __name__ == '__main__':
    login = PageLogin()
    login.page_login('admin', '112234')
    print('错误信息：', login.page_get_result())
    from time import sleep
    sleep(3)
    login.base_close()